import _regeneratorRuntime from "@babel/runtime/regenerator";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";

/**
 * service - 租户初始化处理日志
 * @date: 2019/6/18

 */
import request from 'utils/request';
import { CPAAS_IAM } from 'utils/config';
import { parseParameters } from 'utils/utils';
/**
 * 查询租户初始化处理日志列表
 * @async
 * @function queryLog
 * @param {object} params - 查询参数
 */

export function queryLog(_x) {
  return _queryLog.apply(this, arguments);
}
/**
 * 查询租户初始化处理日志图形数据
 * @async
 * @function queryLogPic
 * @param {string} instanceKey - 实例键值
 */

function _queryLog() {
  _queryLog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
    var param;
    return _regeneratorRuntime.wrap(function _callee$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            param = parseParameters(params);
            return _context.abrupt("return", request("".concat(CPAAS_IAM, "/v1/tenant-init-logs"), {
              method: 'GET',
              query: _objectSpread({}, param)
            }));

          case 2:
          case "end":
            return _context.stop();
        }
      }
    }, _callee);
  }));
  return _queryLog.apply(this, arguments);
}

export function queryLogPic(_x2) {
  return _queryLogPic.apply(this, arguments);
}

function _queryLogPic() {
  _queryLogPic = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(instanceKey) {
    return _regeneratorRuntime.wrap(function _callee2$(_context2) {
      while (1) {
        switch (_context2.prev = _context2.next) {
          case 0:
            return _context2.abrupt("return", request("".concat(CPAAS_IAM, "/v1/tenant-init-logs"), {
              method: 'GET',
              query: {
                instanceKey: instanceKey,
                page: 0,
                size: 999
              }
            }));

          case 1:
          case "end":
            return _context2.stop();
        }
      }
    }, _callee2);
  }));
  return _queryLogPic.apply(this, arguments);
}